<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
	<title><{config_item('website_title')}></title>
	<meta content="initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport">
	<meta content="yes" name="apple-mobile-web-app-capable">
	<meta content="black" name="apple-mobile-web-app-status-bar-style">
	<meta content="telephone=no" name="format-detection">
	<link rel="stylesheet" href="/views/mobile/skin/css/style.css">
</head>
<body >
<!-- content start -->
<section class="wrap" id="comment_list">
	<!--评论模板start-->
	<script type='text/html' id='comment_list_Template'>
		{{each result.list}}
		<div class="commentListbox">
			<div class="commntwrap">
				<div class="commentListL">
					<img src="{{$value.headimgurl}}">
				</div>
				<div class="commemtListR ">
					<div class="commentUser flexbox">
						<div class="commentUserL">
							{{$value.username}}
						</div>
						<div class="commentUserR">
							{{$value.addtime}}
						</div>
					</div>
					<div class="commentcon">
						{{$value.desc}}
					</div>
				</div>
			</div>
		</div>
		{{/each}}
	</script>
	<!--评论模板end-->
</section>
<div class="pages_bar" id="pages_bar" onclick="ajax_list();">加载更多</div>
<script type="text/javascript" src="/public/js/jquery.js" ></script>
<script type="text/javascript" src="/public/js/layer/layer.js"></script>
<script type="text/javascript" src="/public/js/artTemplate.js"></script>
<script type="text/javascript" src="/public/js/laypage/laypage.js"></script>
<script type="text/javascript" src="/views/mobile/skin/js/public.js"></script>
<{include file="mobile/footer.html"}>
<script language="JavaScript">
	var per_page = 1;
	var all_page = 1;
	$(function(){
		ajax_list();
	})
	//ajax评论列表
	function ajax_list(){
		if(per_page>all_page) {
			return false;
		}
		$.ajax({
			type:"POST",
			url: "<{site_url('/api/goods/goods/comment_list')}>",
			data: "id=<{$goods_data.id}>&per_page="+per_page,
			dataType:"json",
			success: function(data){
				if (data.status=='y') {
					var html = template('comment_list_Template',data);
					$('#comment_list').append(html);
					$('#all_count_comment').text(data.result.all_rows);

					per_page++;
					all_page = data.result.page_count;//总页数
					if(per_page>all_page) {
						$('#pages_bar').text('没有更多了');
						return false;
					}
				} else {
					layer.msg(data.info);
				}
			}
		});
	}
</script>
</body>
</html>




